home *** CD-ROM | disk | FTP | other *** search
- ## kill_test.tg
- # This script continually loads and deletes jobs.
- # Part of the normal WinCron regression tests, this script is also useful for those wishing
- # to learn about dynamically loading and destroying jobs.
- # This script assumes:
- # 1. TG.SCRIPT_DIR has been set.
- # This variable is usually set in the Config.tg, auto running script.
-
- # load and kill jobs, forever
- {
- -start
- -name kill_test
- -action -print Loading scripts from: %TG.SCRIPT_DIR%
-
- # load some simple scripts that just print their names repeatedly
- # the scripts are: kill_test_0{1,2,3,4,5,6}.tg
- -action -load "%TG.SCRIPT_DIR%kill_test_0*.tg"
-
- # and do this again in one minute
- -action -inc 0 0 1 0
- }
-
- # load the death-star!, (every 1 minute, 30 seconds)
- # This script will search out and destroy the other scripts:
- # kill_test_0{1,2,3,4,5,6}.tg
- {
- -name START DEATH-STAR
-
- # run 1.5 minutes from now, that should give the above script enough time
- # to load another batch of jobs.
- -start -delay 0 0 1 30
- -action -print looking to start the DEATH-STAR!
- # sleep so we can read the output
- -action -sleep 5000
- -action -load "%TG.SCRIPT_DIR%kill_test_main.tg"
- -action -inc 0 0 1 30
-
- }
-
- # kill the death-star!, (every 1 minute, 40 seconds)
- {
- -name KILL DEATH-STAR
-
- # allow the DEATH-STAR to kill jobs for 10 seconds before we put an end to this monster.
- -start -delay 0 0 1 40
- -action -print looking to kill the DEATH-STAR!
- # sleep so we can read the output
- -action -sleep 5000
- -action -kill THE DEATH-STAR
- -action -inc 0 0 1 40
- }
-
-
-